package com.gwnet.shop.service.impl;

import java.util.List;

import com.gwnet.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gwnet.shop.mapper.SysSchoolMapper;
import com.gwnet.shop.domain.SysSchool;
import com.gwnet.shop.service.ISysSchoolService;

import javax.annotation.Resource;

/**
 * 学校Service业务层处理
 * 
 * @author 张万鹏
 * @date 2024-07-29
 */
@Service
public class SysSchoolServiceImpl implements ISysSchoolService 
{
    @Resource
    private SysSchoolMapper sysSchoolMapper;

    /**
     * 查询学校
     * 
     * @param schoolId 学校主键
     * @return 学校
     */
    @Override
    public SysSchool selectSysSchoolBySchoolId(Long schoolId)
    {
        return sysSchoolMapper.selectSysSchoolBySchoolId(schoolId);
    }

    /**
     * 查询学校列表
     * 
     * @param sysSchool 学校
     * @return 学校
     */
    @Override
    public List<SysSchool> selectSysSchoolList(SysSchool sysSchool)
    {
        return sysSchoolMapper.selectSysSchoolList(sysSchool);
    }

    /**
     * 新增学校
     * 
     * @param sysSchool 学校
     * @return 结果
     */
    @Override
    public int insertSysSchool(SysSchool sysSchool)
    {
        sysSchool.setCreateTime(DateUtils.getNowDate());
        return sysSchoolMapper.insertSysSchool(sysSchool);
    }

    /**
     * 修改学校
     * 
     * @param sysSchool 学校
     * @return 结果
     */
    @Override
    public int updateSysSchool(SysSchool sysSchool)
    {
        sysSchool.setUpdateTime(DateUtils.getNowDate());
        return sysSchoolMapper.updateSysSchool(sysSchool);
    }

    /**
     * 批量删除学校
     * 
     * @param schoolIds 需要删除的学校主键
     * @return 结果
     */
    @Override
    public int deleteSysSchoolBySchoolIds(Long[] schoolIds)
    {
        return sysSchoolMapper.deleteSysSchoolBySchoolIds(schoolIds);
    }

    /**
     * 删除学校信息
     * 
     * @param schoolId 学校主键
     * @return 结果
     */
    @Override
    public int deleteSysSchoolBySchoolId(Long schoolId)
    {
        return sysSchoolMapper.deleteSysSchoolBySchoolId(schoolId);
    }
}
